﻿#include <array>
#include <iostream>

// #include "co/all.h"
#include "opencv2/core/utils/logger.hpp"
#include "opencv2/opencv.hpp"

int main() {
  // 设置默认的coost日志
  // FLG_cout = true;
  // 不写入文件
  // log::set_write_cb([](const void *data, size_t size) {});
  // 设置默认的opencv日志等级,否则打印一堆info信息
  cv::utils::logging::setLogLevel(cv::utils::logging::LOG_LEVEL_WARNING);

  // 读取数据
  auto originalImage{cv::imread(R"(E:\Picture\dog.jpg)", cv::IMREAD_GRAYSCALE)};

  //  cv::imshow("original",originalImage);

  // 均衡化
  std::vector<uint8_t> v{1, 2, 3, 4, 5, 6, 7, 8, 9};
  cv::Mat m{3, 3, CV_8U, v.data()};
  double minV{}, maxV{};
  cv::Point minP{}, maxP{};
  cv::minMaxLoc(m, &minV, &maxV, &minP, &maxP);
  std::cout << minV << " " << maxV << " " << minP << " " << maxP << std::endl;

  return 0;
}
